package org.jks.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

import com.google.gson.annotations.Expose;

@Entity
@Table(name = "Attachment")
public class Attachment {
	@Id
	@GeneratedValue(generator = "increment")
	@GenericGenerator(name = "increment", strategy = "increment")
	@Expose
	private long Id;
	@ManyToOne
	@JoinColumn(name = "Flight", referencedColumnName = "Id", nullable = true)
	@Expose
	private Flight Flight;
	@ManyToOne
	@JoinColumn(name = "Type", referencedColumnName = "Id", nullable = false)
	@Expose
	private AttachmentType Type;
	@Column(length = 64, nullable = false)
	@Expose
	private String Name;
	@Column(length = 256, nullable = false)
	@Expose
	private String Path;
	/** 0: file 1: folder */
	@Expose
	private int FileType;
	@Temporal(TemporalType.TIMESTAMP)
	@Expose
	private Date AddTime;

	public long getId() {
		return Id;
	}

	public void setId(long id) {
		Id = id;
	}

	public Flight getFlight() {
		return Flight;
	}

	public void setFlight(Flight flight) {
		Flight = flight;
	}

	public AttachmentType getType() {
		return Type;
	}

	public void setType(AttachmentType type) {
		Type = type;
	}

	public String getName() {
		return Name;
	}

	public void setName(String name) {
		Name = name;
	}

	public String getPath() {
		return Path;
	}

	public void setPath(String path) {
		Path = path;
	}

	public int getFileType() {
		return FileType;
	}

	public void setFileType(int fileType) {
		FileType = fileType;
	}

	public Date getAddTime() {
		return AddTime;
	}

	public void setAddTime(Date addTime) {
		AddTime = addTime;
	}

}
